#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
using namespace std;

//#define READ_FILE

vector<short>	g_crystals;
short			g_dp[2][2001];

inline short MAX(short x, short y)
{
	return x > y ? x : y;
}

short calc()
{
	short count = g_crystals.size();
	short maxHDiff = 0;
	for (int i = 0; i < count; ++i)
	{
		maxHDiff += g_crystals[i];
	}
	maxHDiff >>= 1;

	g_dp[1][0] = 0;  // DON'T FORGET THIS
	g_dp[0][0] = 0;
	
	for (int i = 0; i < count; ++i)
	{
		for (int hDiff = 0; hDiff <= maxHDiff; ++hDiff)
		{
			if (g_dp[0][hDiff] == -1) { continue; }

			int h = g_crystals[i];

			short shorter = g_dp[0][hDiff];
			short higher = g_dp[0][hDiff] + hDiff;
 
			// crystal i goes to shorter tower
			//
			if (shorter + h > higher)
			{
				g_dp[1][h-hDiff] = MAX( g_dp[1][h-hDiff], higher );
			}
			else
			{
				g_dp[1][hDiff-h] = MAX( g_dp[1][hDiff-h], shorter+h );
			}

			// crystal i goes to higher tower
			//
			g_dp[1][hDiff+h] = MAX( g_dp[1][hDiff+h], shorter);
			
		} // for hDiff

		memcpy(g_dp[0], g_dp[1], sizeof(g_dp[1]));

	} // for i

	return g_dp[0][0];
}

int main()
{
#ifdef READ_FILE
	ifstream readIn("2059.input");
	if (!readIn)
	{
		readIn.open("../2059.input");
	}
#else
#define readIn cin
#endif

	short n;
	while ((readIn >> n) && n != -1)
	{
		g_crystals.clear();
		memset(g_dp, 0xff, sizeof(g_dp));

		for (int i = 0; i < n; ++i)
		{
			short h;
			readIn >> h;
			g_crystals.push_back(h);
		}

		int res = calc();
		if (res <= 0)  // NOT "res != -1"
		{
			cout << "Sorry\n";
		}
		else
		{
			cout << res << endl;
		}
	}
	
	//cin.get();
	return 0;
}
